]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
grabHelper: Make sure to call onUngrabbed for all popped actors
authorJasper St. Pierre <jstpierre@mecheye.net>
Thu, 16 Aug 2012 17:48:22 +0000 (13:48 -0400)
committerJasper St. Pierre <jstpierre@mecheye.net>
Mon, 20 Aug 2012 01:15:50 +0000 (21:15 -0400)
js/ui/grabHelper.js

index a330c04a30c2f5332793891bf9e09686e388447d..780377ff9f399e22b33ad6b55dfe4bfa3de7cf97 100644 (file)
@@ -207,6 +207,7 @@ const GrabHelper = new Lang.Class({
             return;
 
         let poppedGrab = this._grabStack[grabStackIndex];
+        let poppedGrabs = this._grabStack.slice(grabStackIndex);
         // "Pop" poppedGrab and everything after off by truncating the array.
         this._grabStack.length = grabStackIndex;
 
@@ -218,8 +219,10 @@ const GrabHelper = new Lang.Class({
         let focus = global.stage.key_focus;
         let hadFocus = focus && this._isWithinGrabbedActor(focus);
 
-        if (poppedGrab.onUngrab)
-            poppedGrab.onUngrab();
+        for (let i = 0; i < poppedGrabs.length; i++) {
+            if (poppedGrabs[i].onUngrab)
+                poppedGrabs[i].onUngrab();
+        }
 
         // If we took away the last grab, ungrab ourselves.
         if (this._grabStack.length == 0)